package idv.arthur.widgets;

import java.math.BigDecimal;

public class BigDecimalEx {

	public static void main(String[] args) {
		double m = 372913;
		double a = m/1024;
        double b = new BigDecimal(a).setScale(4, BigDecimal.ROUND_HALF_UP)
                       .doubleValue();
        System.out.println("四拾五入到小數點下一位: " + b);
       
        b = new BigDecimal(a).setScale(2, BigDecimal.ROUND_HALF_UP)
                .doubleValue();
        System.out.println("四拾五入到小數點下二位: " + b);

	}

}
